home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8602 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: newshost.lanl.gov!tanmoy
  2. From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: hex to dec function?
  5. Date: 03 Mar 1996 05:06:18 GMT
  6. Organization: Los Alamos National Laboratory
  7. Message-ID: <TANMOY.96Mar2220618@qcd.lanl.gov>
  8. References: <4gdh1b$bg@mailhost.mwmicro.com> <4gdolr$ha9@madeline.INS.CWRU.Edu>
  9.     <4gg3h0INN59e@keats.ugrad.cs.ubc.ca> <danpop.824997504@rscernix>
  10.     <4hab7t$uo4@news.vcnet.com>
  11. NNTP-Posting-Host: qcd.lanl.gov
  12. Mime-Version: 1.0
  13. Content-Type: text
  14. In-reply-to: swedecj@vcnet.com's message of Sat, 02 Mar 1996 20:30:22 GMT
  15.  
  16. In article <4hab7t$uo4@news.vcnet.com>
  17. swedecj@vcnet.com (Carl Jacobson) writes:
  18.  
  19. <snip>
  20. CJ: Why does the following hang my pc when the printf statement is being
  21. <snip>
  22. CJ:    char *pref = "0x";
  23.  
  24. pref now points to a possibly unmodifiable region of memory of length
  25. 3 containing the characters '0','x' and '\0'.
  26.  
  27. <snip>
  28. CJ:       strcat(pref,suff);
  29.  
  30. This tries to overwrite the first '\0' in the region that pref points
  31. to, and copy the contents of the region that suff points to over
  32. this. This has two problems: the region was unmodifiable, and it
  33. simply does not have enough space.
  34.  
  35. Anything from now on is completely unpredicatble.
  36.  
  37. Cheers
  38. Tanmoy
  39. --
  40. tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
  41. Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
  42. Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
  43. <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
  44. internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
  45. fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
  46.